$(function () {
    var url = window.location.href;//获取当前页面的地址
    //http://localhost:8080/student/edit/1

    var urlsplit = url.split("/");
    var len = urlsplit.length;
    var idstr = urlsplit[len-1];//取出id

    $.ajax({
        url:"/webapi/student/"+idstr,
        method : "get",
        success:function (rs) {
            //正确读取学生信息到rs中
            $("#id").val(rs.id);
            $("#name").val(rs.name);
            $("#sex").val(rs.sex);
            $("#score").val(rs.score);
        }
    })
});